<?php

namespace  App\Http\Controllers\V1;

use App\Helpers\RestResponseFactory;
use App\Helpers\RestUtils;
use App\Http\Controllers\Controller;
use App\Models\Factory\SmsFactory;
use App\Models\Factory\UserFactory;
use App\Models\Orm\Banner;
use App\Models\Orm\Carousel;
use App\Services\Core\Sms\Dahan\DahanService;
use Illuminate\Http\Request;
use DB;
/**
 * Class GeetesController
 * @package App\Http\Controllers\V1
 * 短信
 */
class LunBoController extends  Controller
{

    /**
     * 发送短信     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function getContent(Request $request)
    {
        $data = Carousel::select('pictrue','content','phone')->orderBy(DB::raw('RAND()'))->take(6)->get() ;

        return RestResponseFactory::ok($data,200);

    }


//轮播手机号和借款金额

    public function list(Request $request)
    {

        $arr = array(
            130,131,132,133,134,135,136,137,138,139,
            144,147,
            150,151,152,153,155,156,157,158,159,
            176,177,178,
            180,181,182,183,184,185,186,187,188,189,
        );
        for($i = 0; $i < 20; $i++) {
            $tmp[$i]['content'] = '用户'.$arr[array_rand($arr)].'****'.mt_rand(1000,9999).'成功借款'.rand(5,50).'00元';
            $tmp[$i]['time'] = rand(1,15).'分钟';

        }





        return RestResponseFactory::ok($tmp,200);





    }


}